﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Duoease.ContainerModel.Entity
{
    public class CMFactory
    {
        public CMFactory()
        { 
        }
        private static CMFactory inst = null;
        public static CMFactory GetInstance()
        {
            if (inst == null)
                inst = new CMFactory();
            return inst;
        }

        public BaseModel CreateModel(string name)
        {
            BaseModel model = null;
            switch (name)
            {
                case "VerticalFridge":
                    model = new VerticalFridge();
                    break;
                case "HorizontalFridge":
                    model = new HorizontalFridge();
                    break;
                case "LiquidNitrogenJar":
                    model = new LiquidNitrogenJar();
                    break;
                case "ShelfModel":
                    model = new ShelfModel();
                    break;
                case "BoxModel":
                    model = new BoxModel();
                    break;
            }
            return model;
        }
    }
}
